home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / Enumeration.java < prev    next >
Text File  |  1998-09-22  |  2KB  |  66 lines

  1. /*
  2.  * @(#)Enumeration.java    1.12 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.util;
  16.  
  17. /**
  18.  * An object that implements the Enumeration interface generates a 
  19.  * series of elements, one at a time. Successive calls to the 
  20.  * <code>nextElement</code> method return successive elements of the 
  21.  * series. 
  22.  * <p>
  23.  * For example, to print all elements of a vector <i>v</i>:
  24.  * <blockquote><pre>
  25.  *     for (Enumeration e = v.elements() ; e.hasMoreElements() ;) {
  26.  *         System.out.println(e.nextElement());<br>
  27.  *     }
  28.  * </pre></blockquote>
  29.  * <p>
  30.  * Methods are provided to enumerate through the elements of a 
  31.  * vector, the keys of a hashtable, and the values in a hashtable. 
  32.  * Enumerations are also used to specify the input streams to a 
  33.  * <code>SequenceInputStream</code>. 
  34.  *
  35.  * @see     java.io.SequenceInputStream
  36.  * @see     java.util.Enumeration#nextElement()
  37.  * @see     java.util.Hashtable
  38.  * @see     java.util.Hashtable#elements()
  39.  * @see     java.util.Hashtable#keys()
  40.  * @see     java.util.Vector
  41.  * @see     java.util.Vector#elements()
  42.  *
  43.  * @author  Lee Boynton
  44.  * @version 1.12, 07/01/98
  45.  * @since   JDK1.0
  46.  */
  47. public interface Enumeration {
  48.     /**
  49.      * Tests if this enumeration contains more elements.
  50.      *
  51.      * @return  <code>true</code> if this enumeration contains more elements;
  52.      *          <code>false</code> otherwise.
  53.      * @since   JDK1.0
  54.      */
  55.     boolean hasMoreElements();
  56.  
  57.     /**
  58.      * Returns the next element of this enumeration.
  59.      *
  60.      * @return     the next element of this enumeration. 
  61.      * @exception  NoSuchElementException  if no more elements exist.
  62.      * @since      JDK1.0
  63.      */
  64.     Object nextElement();
  65. }
  66.